package com.wiki.gds.app.controller;


import com.wiki.gds.base.web.controller.common.BaseController;
import com.wiki.gds.member.facade.member.api.MemberApi;
import com.wiki.gds.user.facade.sys.api.UserApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("test")
public class TestController extends BaseController{

    @Autowired
    private UserApi api;

    @Autowired
    private MemberApi memberApi;

    @RequestMapping("/a1")
    @ResponseBody
    public String test1(){
        Object userDetails=SecurityContextHolder.getContext().getAuthentication().getPrincipal();

System.out.println(userDetails);
        return "111";
     }

    @RequestMapping("/a2")
    @ResponseBody
    public String test2(){


        return api.TestAAA();
    }

    @RequestMapping("/a3")
    @ResponseBody
    public String test3(){


        return memberApi.Test();
    }
//
//    @RequestMapping("/a3")
//    @ResponseBody
//    public ResponseDto test3(){
//        PageQuery pageQuery=new PageQuery();
//        pageQuery.setPara("id",1);
//        pageQuery.setPara("as",2);
//        pageQuery.setPageNumber(1);
//        pageQuery.setPageSize(5);
//        return api.getPageQuery(pageQuery);
//    }
}
